package cn.yshujia.domain.entity;

import cn.yshujia.handler.EncryptionHandler;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author YShuJia
 * @since 2024/4/23
 */

@Data
@Accessors (chain = true)
@TableName (value = "t_develop", autoResultMap = true)
@Schema (name = "Develop", description = "")
public class Develop implements Serializable {
	
	@Serial
	private static final long serialVersionUID = 1L;
	
	@Schema (description = "主键")
	@TableId (value = "id", type = IdType.AUTO)
	private Long id;
	
	@Schema (description = "分支")
	@TableField ("branch")
	private String branch;
	
	@Schema (description = "提交者")
	@TableField ("author")
	private String author;
	
	@Schema (description = "提交者邮箱")
	@TableField (value = "email", typeHandler = EncryptionHandler.class)
	private String email;
	
	@Schema (description = "提交者gitee首页")
	@TableField ("home")
	private String home;
	
	@Schema (description = "提交者头像")
	@TableField ("avatar")
	private String avatar;
	
	@Schema (description = "提交信息")
	@TableField ("message")
	private String message;
	
	@Schema (description = "哈希")
	@TableField ("sha")
	private String sha;
	
	@Schema (description = "父提交哈希")
	@TableField ("parent_sha")
	private String parentSha;
	
	@Schema (description = "提交时间")
	@TableField ("`time`")
	@JsonFormat (pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date time;
	
	@Schema (description = "提交地址")
	@TableField ("url")
	private String url;
	
	@Schema (description = "是否可见")
	@TableField ("`status`")
	private Boolean status;
}
